package com.google.gwt.gfx.client.overlays;

import com.google.gwt.gfx.client.GFXPanel;
import com.google.gwt.gfx.client.style.AnchorStyle;
import com.google.gwt.gfx.client.style.DefaultStyle;
import com.google.gwt.user.client.ui.DecoratorPanel;

public class InfoWindow<B extends GFXPanel<?, ?, ?>> extends DecoratorPanel
		implements AnchorOverlay {

	private AnchorStyle anchorRef;

	private DefaultStyle styleRef;

	public InfoWindow() {
		super();

		styleRef = new DefaultStyle(this);
		anchorRef = new AnchorStyle(this) {

			@Override
			public int getCenterDeltaLeft() {
				return getAnchorCenterDeltaLeft();
			}

			@Override
			public int getCenterDeltaTop() {
				return getAnchorCenterDeltaTop();
			};

		};

		addStyleName("gfx-InfoWindow");
	}

	@Override
	public AnchorStyle anchor() {
		return anchorRef;
	}

	protected int getAnchorCenterDeltaLeft() {
		return 0;
	}

	protected int getAnchorCenterDeltaTop() {
		return 0;
	}

	@Override
	public DefaultStyle style() {
		return styleRef;
	}

}
